﻿
﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Prism.Events;
using Prism.Ioc;
using Prism.Modularity;
using Prism.Unity;
using Prism.Mvvm;
using Unity;
using Prism.Navigation.Regions;
using Prism.Navigation.Regions;

namespace NurseStation.common
{
    /// <summary>
    /// viewmodel公用属性抽出父类
    /// </summary>
    public class VmBase : BindableBase
    {
        protected IContainerExtension container;
        protected IRegionManager regionManager;
        protected IRegionNavigationService navigationService;
        protected IEventAggregator eventAggregator;
        protected IModuleManager moduleManager;
        public VmBase(IContainerExtension container, IEventAggregator eventAggregator, IRegionManager regionManager)
        {
            this.container = container;
            //this.regionManager = container.Resolve<IRegionManager>();
            this.regionManager = regionManager;
            this.navigationService = container.Resolve<IRegionNavigationService>();
            this.moduleManager = container.Resolve<IModuleManager>();
            this.eventAggregator = eventAggregator;

        }
        public VmBase(IContainerExtension container, IEventAggregator eventAggregator)
        {
            this.container = container;
            this.regionManager = container.Resolve<IRegionManager>();
            this.navigationService = container.Resolve<IRegionNavigationService>();
            this.moduleManager = container.Resolve<IModuleManager>();
            this.eventAggregator = eventAggregator;
        }
    }
}

